package com.gwtgeo.ui.client.gin;

import net.customware.gwt.presenter.client.DefaultEventBus;
import net.customware.gwt.presenter.client.EventBus;
import net.customware.gwt.presenter.client.gin.AbstractPresenterModule;
import net.customware.gwt.presenter.client.place.PlaceManager;

import com.google.inject.Singleton;
import com.gwtgeo.ui.client.mvp.AppPresenter;
import com.gwtgeo.ui.client.mvp.desktop.DesktopPresenter;
import com.gwtgeo.ui.client.mvp.desktop.DesktopView;
import com.gwtgeo.ui.client.mvp.layers.AddLayerPresenter;
import com.gwtgeo.ui.client.mvp.layers.AddLayerView;
import com.gwtgeo.ui.client.mvp.layers.LayersPresenter;
import com.gwtgeo.ui.client.mvp.layers.LayersView;
import com.gwtgeo.ui.client.mvp.loadmap.LoadMapPresenter;
import com.gwtgeo.ui.client.mvp.loadmap.LoadMapView;
import com.gwtgeo.ui.client.mvp.map.MapPresenter;
import com.gwtgeo.ui.client.mvp.map.MapView;
import com.gwtgeo.ui.client.mvp.newmap.NewMapPresenter;
import com.gwtgeo.ui.client.mvp.newmap.NewMapView;
import com.gwtgeo.ui.client.mvp.savemapas.SaveMapAsPresenter;
import com.gwtgeo.ui.client.mvp.savemapas.SaveMapAsView;
import com.gwtgeo.ui.client.mvp.searchform.SearchFormPresenter;
import com.gwtgeo.ui.client.mvp.searchform.SearchFormView;
import com.gwtgeo.ui.client.mvp.searchresults.SearchResultsPresenter;
import com.gwtgeo.ui.client.mvp.searchresults.SearchResultsView;
import com.gwtgeo.ui.client.mvp.windowsmanager.WindowsManager;

public class GwtgeoClientModule extends AbstractPresenterModule {

	@Override
	protected void configure() {

		bind(EventBus.class).to(DefaultEventBus.class).in(Singleton.class);
		bind(PlaceManager.class).in(Singleton.class);
		bind(WindowsManager.class).in(Singleton.class);
		bind(AppPresenter.class).in(Singleton.class);

		bindPresenter(DesktopPresenter.class, DesktopPresenter.Display.class,
				DesktopView.class);
		bindPresenter(MapPresenter.class, MapPresenter.Display.class,
				MapView.class);
		bindPresenter(SearchFormPresenter.class,
				SearchFormPresenter.Display.class, SearchFormView.class);
		bindPresenter(SearchResultsPresenter.class,
				SearchResultsPresenter.Display.class, SearchResultsView.class);
		bindPresenter(LayersPresenter.class, LayersPresenter.Display.class,
				LayersView.class);
		bindPresenter(SaveMapAsPresenter.class,
				SaveMapAsPresenter.Display.class, SaveMapAsView.class);
		bindPresenter(LoadMapPresenter.class, LoadMapPresenter.Display.class,
				LoadMapView.class);
		bindPresenter(AddLayerPresenter.class, AddLayerPresenter.Display.class,
				AddLayerView.class);
		bindPresenter(NewMapPresenter.class, NewMapPresenter.Display.class,
				NewMapView.class);
	}
}